package com.haois.mp.database.module.offaccounts.dao;

import com.haois.mp.database.module.common.daomain.Driver;
import com.haois.mp.database.module.common.daomain.Vehicle;
import com.haois.mp.database.module.common.daomain.Peccancy;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;

/**
 * description
 *
 * @author RuiHaoZ on GuangZhou
 * @date 2018/9/2 15:25
 */
@Repository
public interface VehicleMapper {

    List<Vehicle> findVehicle();

    List<Vehicle> findVehicleByMem(@Param("memberNum") String memberNum);

    Vehicle findVehicleByPlate(@Param("plate") String plate);

    Peccancy findPeccancyByArchiveNo(@Param("archiveNo") String archiveNo);

    Peccancy findPeccancyById(@Param("pid") Integer pid);

    Peccancy findPeccancyByPlateAndDate(@Param("vehPlate") String vehPlate, @Param("date") String date);

    List<Peccancy> findPeccancyBy(@Param("memberNum") String memberNum, @Param("handled") String handled,
                                        @Param("plate") String plate, @Param("beginTime") String beginTime, @Param("endTime") String endTime);

    void insertPeccancy(@Param("pec") Peccancy peccancy);

    void updatePeccancy(@Param("pec") Peccancy peccancy);

    void insertVehicle(@Param("vehicle") Vehicle vehicle);

    void insertDriver(@Param("driver") Driver driver);

    void insertVehicleMem(@Param("vehicleId") int vehicleId,
                          @Param("memberNum") String memberNum, @Param("self") Integer self);

    Integer countVehicleMem(@Param("vehicleId") int vehicleId,
                            @Param("memberNum") String memberNum);

    Integer countDriverMem(@Param("driverId") int driverId,
                           @Param("memberNum") String memberNum);

    void insertDriverMem(@Param("driverId") int driverId,
                         @Param("memberNum") String memberNum, @Param("self") Integer self);

    List<String> findMemByVehicle(@Param("id") Integer id);

    List<String> findMemByDriver(@Param("id") Integer id);

    List<Driver> findDriver();

    List<Driver> findDriverByMem(@Param("memberNum") String memberNum);

    void updateDriverWzInfo(@Param("driver") Driver driver);

    void updateVehicleWzUpDateTime(@Param("vehicle") Vehicle vehicle);

    void updateVehicleInspectTime(@Param("vehicle") Vehicle vehicle);

    Driver getDriver(@Param("driver") Driver driver);

    Vehicle getVehicle(@Param("vehicle") Vehicle vehicle);

    Driver getDriverOr(@Param("driver") Driver driver);

    Vehicle getVehicleOr(@Param("vehicle") Vehicle vehicle);

    void updateVehicle(@Param("vehicle") Vehicle vehicle);

    void updateDriver(@Param("driver") Driver driver);
}
